<?php

// Get variables

$apis = v('apis');
$directory = v('directory');
$extensionId = v('extensionId');
$fileName = v('fileName');

?>

<!-- breadcrump -->

<ul class="breadcrumb">
	<li >
		<a href="<?php p(url('[Loop]/page/admin/sandbox/')); ?>" >
			List of files
		</a>
		<span class="divider">/</span>
	</li>
	<li class="active" >
		<?php p($extensionId);?>/<?php p($directory);?>/<?php p($fileName);?>
	</li>
</ul>

<h4 style="text-align: center;">
	<?php p($extensionId);?>/<?php p($directory);?>/<?php p($fileName);?>
</h4>

<div>
	<table class="table table-hover table-bordered">
		<thead>
		    <tr>
		      <th>Name</th>
		      <th>Description</th>
		    </tr>
		</thead>
		<tbody>
		<?php
			// For each api found, print it with description

			foreach ($apis as $apiName => $details)
			{
		?>
				<tr>
					<td>
						<a href="<?php p(url('[Loop]/page/admin/sandbox/api/') . '?extensionId=' . $extensionId .'&directory=' . $directory . '&fileName=' . $fileName . '&api=' . $apiName);?>">			
						<?php
							// Remove api_

							p(substr($apiName, 4)); 
						?>
						</a> 
					</td>
					<td>
						<?php
							if (empty($details['description']) === false) 
							{
						?>
							 <?php p($details['description']); ?>
						<?php
							}
						?>
					</td>
				</tr>
		<?php
			}
		?>
		</tbody>
	</table>
</div>
